package cn.jaye.fabric.application;

import cn.jaye.fabric.common.constant.Global;
import cn.jaye.fabric.domain.service.RestTemplateService;
import com.alibaba.fastjson.JSONObject;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.stereotype.Service;

import java.util.Set;

/**
 * Created by Administrator on 2018/5/27.
 */
@Service
public class ChannelApplicationService {

    @Autowired
    private RestTemplateService restTemplateService;


    private static final String CHANNEL_LIST = "/channel/list";

    public JSONObject list() {
        String url = Global.FABRRIC_GATEWAY_ADDRESS + CHANNEL_LIST;
        JSONObject postData = new JSONObject();
        JSONObject resultObject = restTemplateService.getUrlResponse(url, postData);
        return resultObject;
    }
}
